import Vue from "vue";
import Vuex from "vuex";

//挂载Vuex
Vue.use(Vuex);

//创建VueX对象
const store = new Vuex.Store({
  state: {
    yb_schoolname: "",
    yb_userid: "",
    yb_userhead: "",
    yb_usernick: "",
    test: 0,
  },
  mutations: {
    edit(state, payload) {
      (state.yb_usernick = payload.yb_usernick),
        (state.yb_schoolname = payload.yb_schoolname),
        (state.yb_userhead = payload.yb_userhead),
        (state.yb_userid = payload.yb_userid);
    },
    change(state) {
      state.test++;
    },
  },
  actions: {},
});

export default store;
